﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyThuVien.Business;

namespace QuanLyThuVien.Presentation
{
    public partial class frmTKeDocGia : Form
    {
        public frmTKeDocGia()
        {
            InitializeComponent();
        }
        PhieuMuonBUS BusPhieuMuon = new PhieuMuonBUS();

        DocGiaBUS BusDG = new DocGiaBUS();

        TheBUS BusThe = new TheBUS();

        private void rdbDGMuonQuaHan_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void rbDGDangMuonSach_CheckedChanged(object sender, EventArgs e)
        {
            BusPhieuMuon.LoadLenDataGridView(dgTK1);
        }

        private void frmTKeDocGia_Load(object sender, EventArgs e)
        {
            BusDG.LoadLenDG(dgTK1);
            BusDG.LoadLenDG(dgTK2);
        }

        private void rdbThongKeThe_CheckedChanged(object sender, EventArgs e)
        {
            BusThe.LoadLenDataGridView(dgTK1);
        }

        private void rbDSDG_CheckedChanged(object sender, EventArgs e)
        {
            BusDG.LoadLenDG(dgTK1);
        }

        private void dgTK2_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int a = e.RowIndex;
            lbTen.Text = dgTK2[1, a].Value.ToString();
            lbSoLan.Text = BusPhieuMuon.DemDGMuonSach(dgTK2[0, a].Value.ToString());
        }
    }
}
